package movee;

import movee.config.FtpProperties;
import movee.domain.mapper.BackupDeviceMapper;
import movee.manager.ftp.FtpTools;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 网络配置管理入口程序
 *
 * @author movee
 * @version 1.0.0
 * @since 1.0.0
 */
@EnableFeignClients
@EnableDiscoveryClient
@EnableScheduling
@EnableAsync
@SpringBootApplication
@Slf4j
public class SpringProjectFrameworkApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringProjectFrameworkApplication.class, args);
    }

    @Bean
    @SuppressWarnings("unchecked")
    public CommandLineRunner runner(BackupDeviceMapper deviceMapper,
                                    FtpProperties ftpProperties,
                                    FtpTools ftpTools) {

        return (args) -> {

            try {
                log.debug("=====begin SpringProjectFrameworkApplication runner");



                log.debug("=====finish SpringProjectFrameworkApplication runner");
            } catch (Throwable t) {
                log.error("====={}", ExceptionUtils.getStackTrace(t));
            }

        };
    }
}
